
#include "register.h"
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char ** argv)
{   
	if (argc < 2) {
		printf("argc error\n");
		return -1;
	}

	unsigned char value = atoi(argv[1]);

	printf("value %02x\n", value);

	//修改端口权限为可读写
	int ret = iopl(3);
	if(ret == -1)
	{
		printf("iopl error.\n");
		return -1;
	}
	 

	outb(0x0c, 0xa35);
	outb(0x00, 0xa36); //这个是对寄存器读写

	//outb(0x7b, 0xa35);
	//outb(value, 0xa36);

	int i,j;
    for (i = 0; i < ARRAY_SIZE(superio_ports_table); i++) {
		for (j = 0; superio_ports_table[i].ports[j] != EOT; j++)
			superio_ports_table[i].probe_idregs(
				superio_ports_table[i].ports[j]);
	}

    iopl(0);

	printf("register end\n");
	printf("value %02x\n", value);
	
	return 0;
}
